'use strict';
const db = uniCloud.database()
exports.main = async (event, context) => {
	const collection = db.collection('unicloud-test')
	
	const dbCmd = db.command
	let res = await collection.where({
	  _id: dbCmd.exists(true)
	}).remove()
	
	if (res.deleted === 1) {
		return {
			status: 200,
			msg: '清空成功'
		}
	} else {
		return {
			status: 400,
			msg: '删除数据失败'
		}
	}
	
	
	
};
